package StudyCode.summary.myfile;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class DeleteFileIfExists {
	public static void main(String[] args) throws Exception {
		Path sourceFile = Paths.get("E:\\Copy\\test1.txt");
		Files.deleteIfExists(sourceFile);
		System.out.println("删除成功。");
	}
}
